const https = require("https");
const fs = require("fs");
const path = require("path");
const cheerio = require('cheerio');


https.get('https://moviw.douban.com/chart'),function (res){
    const supplyStockResult = [];
    res.setEncoding("uft-8"); // 设置编码

    // 抓取内容
    res.on('data', (chunk)=>{
        console.log("chunk", chunk)
    });

    //
    res.on('end', function (){
        // 使用 cheerio加载住区到的H
    })
}


function saveData(path, supplyStock){
    fs.writeFile(path,JSON.stringify(supplyStock, null, 4), err=>{
        if(err){
            return console.log(err);
        }
        console.log('Data saved!');
    })
}
